.section .text
.globl	_start
_start:

main:
        str     fp, [sp, #-4]!
        add     fp, sp, #0
        sub     sp, sp, #12
        mov     r3, #0
        str     r3, [fp, #-8]
        mov     r3, #1
        str     r3, [fp, #-12]
        b       .L2
.L3:
        ldr     r2, [fp, #-8]
        ldr     r3, [fp, #-12]
        add     r3, r2, r3
        str     r3, [fp, #-8]
        ldr     r3, [fp, #-12]
        add     r3, r3, #1
        str     r3, [fp, #-12]
.L2:
        ldr     r3, [fp, #-12]
        cmp     r3, #1000
        movgt   r3, #0
        movle   r3, #1
        and     r3, r3, #255
        cmp     r3, #0
        bne     .L3
        ldr     r3, [fp, #-8]
        mov     r0, r3
        add     sp, fp, #0
        ldmfd   sp!, {fp}
        bx      lr
